<?php
namespace Models;
class User extends Model {

    public function create($data) {
        $sql = 'insert into users(username, password) 
        values ("' . $data['username'] . '", "' . $data['password']. '")';
        return $this->pdo->exec($sql);
    }

    public function getUserByUsername($username) {
        $sql = 'select * from users where username = "' . $username . '"';
        $stmt = $this->pdo->query($sql);
        return $stmt->fetch(\PDO::FETCH_ASSOC);
    }
}